<?php 
session_start();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Compra Livros</title>
</head>

<?php
include("..\conexao\conecta_mysql.inc");

echo "<p>Limite na session: ".$_SESSION['limite']."</p>";

$resultado = mysql_query("SELECT * FROM livro") ;
$linha = mysql_num_rows($resultado);
echo $linha;
for ($i=0; $i<$linha; $i++){
	echo "entrei";
	$nome = mysql_result($resultado,$i,"NOME");
	$valor = mysql_result($resultado, $i, "VALOR");

	echo $i;
	echo $nome.$valor;

}

echo "sai";
mysql_close($conexao);
?>

<form action="verificaCredito.php" method="post" target="_self">

<body>
<table width="10%" height="10%" border="1" align="center"> 
	<tr>
		<td><?php echo $nome; ?></td>
		<td><?php echo $valor; ?></td>
		<td> <input name="lista[]" type="checkbox" value=" <?php echo $valor; ?> "/></td>
	</tr>
	<tr>
		<td><?php echo $nome."1"; ?></td>
		<td><?php echo $valor."1"; ?></td>
		<td> <input name="lista[]" type="checkbox" value=" <?php echo $valor; ?> "/></td>
	</tr>
	
</table>

<button type="submit">calcula</button>
</form>
</body>
</html>
